package com.first.order.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.first.common.pojo.EduVideo;
import com.first.order.dao.QianEduVideoDao;
import com.first.order.service.QianEduVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * @program: SecondProject
 * @description:
 * @author: 李榕轩
 * @create: 2023-06-02 17:19
 **/
@Service
public class QianEduVideoServiceImpl implements QianEduVideoService {
    @Autowired
    private QianEduVideoDao qianEduCourseDao;
    @Override
    public List<EduVideo> queryAllVideoByCourseId(String id) {
        QueryWrapper<EduVideo> wrapper = new QueryWrapper<>();
        if (StringUtils.hasText(id)){
            wrapper.eq("course_id",id);
        }
        List<EduVideo> eduVideos = qianEduCourseDao.selectList(wrapper);
        return eduVideos;
    }
}
